package lambda;

import java.io.File;
import java.io.FileFilter;

public class LambdaDemo {
    public static void main(String[] args) {
        File dir = new File("./src/main/java/file");
        if (dir.isDirectory()) {
            FileFilter filter = f -> f.getName().contains("F");


           /* File[] subs = dir.listFiles(filter);
            for (File sub : subs){
                System.out.println(sub.getName());
            }*/
            File[] subs = dir.listFiles(f -> f.getName().contains("F"));
            for (File sub : subs) {
                System.out.println(sub.getName());
            }
        }

    }
}
